home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / CVideoCompressor.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-20  |  5.4 KB  |  210 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    Copyright (C) 1998-2001 Avery Lee
  3. //
  4. //    This program is free software; you can redistribute it and/or modify
  5. //    it under the terms of the GNU General Public License as published by
  6. //    the Free Software Foundation; either version 2 of the License, or
  7. //    (at your option) any later version.
  8. //
  9. //    This program is distributed in the hope that it will be useful,
  10. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. //    GNU General Public License for more details.
  13. //
  14. //    You should have received a copy of the GNU General Public License
  15. //    along with this program; if not, write to the Free Software
  16. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #include "CVideoCompressor.h"
  19.  
  20. CVideoCompressor::~CVideoCompressor() {
  21. }
  22.  
  23. LRESULT CVideoCompressor::About(HWND hwnd) {
  24.     return ICERR_UNSUPPORTED;
  25. }
  26.  
  27. LRESULT CVideoCompressor::CompressBegin(BITMAPINFO *lpbiInput, BITMAPINFO *lpbiOutput) {
  28.     return CompressQuery(lpbiInput, lpbiOutput);
  29. }
  30.  
  31. LRESULT CVideoCompressor::CompressEnd() {
  32.     return ICERR_OK;
  33. }
  34.  
  35. LRESULT CVideoCompressor::Configure(HWND hwnd) {
  36.     return ICERR_UNSUPPORTED;
  37. }
  38.  
  39. LRESULT CVideoCompressor::Decompress(ICDECOMPRESS *icd, DWORD cbSize) {
  40.     ICDECOMPRESSEX icdex;
  41.  
  42.     icdex.dwFlags        = icd->dwFlags;
  43.     icdex.lpbiSrc        = icd->lpbiInput;
  44.     icdex.lpSrc            = icd->lpInput;
  45.     icdex.lpbiDst        = icd->lpbiOutput;
  46.     icdex.lpDst            = icd->lpOutput;
  47.     icdex.xDst            = 0;
  48.     icdex.yDst            = 0;
  49.     icdex.dxDst            = -1;
  50.     icdex.dyDst            = -1;
  51.     icdex.xSrc            = 0;
  52.     icdex.ySrc            = 0;
  53.     icdex.dxSrc            = -1;
  54.     icdex.dySrc            = -1;
  55.  
  56.     return DecompressEx(&icdex, sizeof icdex);
  57. }
  58.  
  59. LRESULT CVideoCompressor::DecompressBegin(BITMAPINFO *lpbiInput, BITMAPINFO *lpbiOutput) {
  60.     return DecompressQuery(lpbiInput, lpbiOutput);
  61. }
  62.  
  63. LRESULT CVideoCompressor::DecompressEnd() {
  64.     return ICERR_OK;
  65. }
  66.  
  67. LRESULT CVideoCompressor::DecompressGetPalette(BITMAPINFOHEADER *lpbiInput, BITMAPINFOHEADER *lpbiOutput) {
  68.     return ICERR_UNSUPPORTED;
  69. }
  70.  
  71. LRESULT CVideoCompressor::DecompressQuery(BITMAPINFO *lpbiInput, BITMAPINFO *lpbiOutput) {
  72.     ICDECOMPRESSEX icdex;
  73.  
  74.     icdex.dwFlags        = 0;
  75.     icdex.lpbiSrc        = (BITMAPINFOHEADER *)lpbiInput;
  76.     icdex.lpSrc            = NULL;
  77.     icdex.lpbiDst        = (BITMAPINFOHEADER *)lpbiOutput;
  78.     icdex.lpDst            = NULL;
  79.     icdex.xDst            = 0;
  80.     icdex.yDst            = 0;
  81.     icdex.dxDst            = -1;
  82.     icdex.dyDst            = -1;
  83.     icdex.xSrc            = 0;
  84.     icdex.ySrc            = 0;
  85.     icdex.dxSrc            = -1;
  86.     icdex.dySrc            = -1;
  87.  
  88.     return DecompressExQuery(&icdex, sizeof icdex);
  89. }
  90.  
  91. LRESULT CVideoCompressor::DecompressSetPalette    (BITMAPINFOHEADER *lpbiPalette) {
  92.     return ICERR_UNSUPPORTED;
  93. }
  94.  
  95. LRESULT CVideoCompressor::DecompressExBegin(ICDECOMPRESSEX *icdex, DWORD cbSize) {
  96.     return DecompressExQuery(icdex, cbSize);
  97. }
  98.  
  99. LRESULT CVideoCompressor::DecompressExEnd() {
  100.     return ICERR_OK;
  101. }
  102.  
  103. LRESULT CVideoCompressor::Draw(ICDRAW *icdraw, DWORD cbSize) {
  104.     return ICERR_UNSUPPORTED;
  105. }
  106.  
  107. LRESULT CVideoCompressor::DrawBegin(ICDRAWBEGIN *icdrwBgn, DWORD cbSize) {
  108.     return ICERR_UNSUPPORTED;
  109. }
  110. LRESULT CVideoCompressor::DrawChangePalette(BITMAPINFO *lpbiInput) {
  111.     return ICERR_UNSUPPORTED;
  112. }
  113.  
  114. LRESULT CVideoCompressor::DrawEnd() {
  115.     return ICERR_UNSUPPORTED;
  116. }
  117.  
  118. LRESULT CVideoCompressor::DrawFlush() {
  119.     return ICERR_UNSUPPORTED;
  120. }
  121.  
  122. LRESULT CVideoCompressor::DrawGetPalette() {
  123.     return ICERR_UNSUPPORTED;
  124. }
  125.  
  126. LRESULT CVideoCompressor::DrawGetTime(DWORD *lplTime) {
  127.     return ICERR_UNSUPPORTED;
  128. }
  129.  
  130. LRESULT CVideoCompressor::DrawQuery(BITMAPINFO *lpbiInput) {
  131.     return ICERR_UNSUPPORTED;
  132. }
  133.  
  134. LRESULT CVideoCompressor::DrawRealize(HDC hdc, BOOL fBackground) {
  135.     return ICERR_UNSUPPORTED;
  136. }
  137.  
  138. LRESULT CVideoCompressor::DrawRenderBuffer() {
  139.     return ICERR_UNSUPPORTED;
  140. }
  141.  
  142. LRESULT CVideoCompressor::DrawSetTime(DWORD lpTime) {
  143.     return ICERR_UNSUPPORTED;
  144. }
  145.  
  146. LRESULT CVideoCompressor::DrawStart() {
  147.     return 0;
  148. }
  149.  
  150. LRESULT CVideoCompressor::DrawStartPlay(DWORD lFrom, DWORD lTo) {
  151.     return ICERR_UNSUPPORTED;
  152. }
  153.  
  154. LRESULT CVideoCompressor::DrawStop() {
  155.     return ICERR_UNSUPPORTED;
  156. }
  157.  
  158. LRESULT CVideoCompressor::DrawStopPlay() {
  159.     return ICERR_UNSUPPORTED;
  160. }
  161.  
  162. LRESULT CVideoCompressor::DrawSuggestFormat(ICDRAWSUGGEST *icdrwSuggest, DWORD cbSize) {
  163.     return icdrwSuggest->lpbiSuggest ? sizeof(BITMAPINFOHEADER) : ICERR_UNSUPPORTED;
  164. }
  165.  
  166. LRESULT CVideoCompressor::DrawWindow(RECT *prc) {
  167.     return ICERR_UNSUPPORTED;
  168. }
  169.  
  170. LRESULT CVideoCompressor::Get(LPVOID pv, DWORD cbSize) {
  171.     return 0;
  172. }
  173.  
  174. LRESULT CVideoCompressor::GetBuffersWanted(DWORD *lpdwBuffers) {
  175.     return ICERR_UNSUPPORTED;
  176. }
  177.  
  178. LRESULT CVideoCompressor::GetDefaultKeyFrameRate(DWORD *lpdwICValue) {
  179.     return ICERR_UNSUPPORTED;
  180. }
  181.  
  182. LRESULT CVideoCompressor::GetDefaultQuality(DWORD *lpdwICValue) {
  183.     return ICERR_UNSUPPORTED;
  184. }
  185.  
  186. LRESULT CVideoCompressor::GetQuality(DWORD *lpdwICValue) {
  187.     return ICERR_UNSUPPORTED;
  188. }
  189.  
  190. LRESULT CVideoCompressor::GetState(LPVOID pv, DWORD cbSize) {
  191.     return cbSize ? 1 : 0;
  192. }
  193.  
  194. LRESULT CVideoCompressor::SetStatusProc(ICSETSTATUSPROC *icsetstatusProc, DWORD cbSize) {
  195.     return ICERR_OK;
  196. }
  197.  
  198. LRESULT CVideoCompressor::SetQuality(DWORD *lpdwICValue) {
  199.     return ICERR_UNSUPPORTED;
  200. }
  201.  
  202. LRESULT CVideoCompressor::SetState(LPVOID pv, DWORD cbSize) {
  203.     return cbSize;
  204. }
  205.  
  206. LRESULT CVideoCompressor::Default(DWORD dwDriverID, HDRVR hDriver, UINT uiMessage, LPARAM lParam1, LPARAM lParam2) {
  207.     return ICERR_UNSUPPORTED;
  208. }
  209.  
  210.